Merged
Conversation
|
Thanks for your contribution! |
Collaborator
Author
# vectorize_op_seq.py
VecorizationResult :=
Object
* $samples list[$features list[$count_of_sub_op_seq int]]
* $embedding list[$sub_op_seq tuple[str]] # len(embedding) == len($features)
vectorize_op_seq :=
$ret VecorizationResult
<- $input_varidic_op_seq list[$op_seq list[str]]
<- $sub_op_seq_len_limit int # default 6
# inline
<- (list[$sub_op_seq_start int] <- range <- ($len_op_seq <- len <- $op_seq))
<- (list[$sub_op_seq_len int] <- range <- $sub_op_seq_len_limit)
<- $get_sub_op_seq ($sub_op_seq tuple[str] <- $op_seq <- $sub_op_seq_start <- $sub_op_seq_len)
<- ($embedding_set set[$sub_op_seq tuple[str]] <- $get_sub_op_seq <- $input_varidic_op_seq)
<- ($embedding list[$sub_op_seq tuple[str]] <- $embedding_set)
<- ($embedding_map dict[$sub_op_seq tuple[str], $sub_op_seq_index] <- $embedding)
<- $get_one_sample_feature_dict (dict[$sub_op_seq tuple[str], $count_of_sub_op_seq int] <- $op_seq list[str])
<- ($samples list[$features list[$count_of_sub_op_seq int]] <- $get_one_sample_feature_dict <- $input_varidic_op_seq <- $embedding_map)
<- ($ret <- ...)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Description